<template>
  <div class="sz-demo sz-demo-login">
    <!-- 基础用法 -->
    <el-divider content-position="left"><b>基础用法</b></el-divider>
    <section>
      <sz-login
        ref="login"
        platform="bk"
        :actionList="['account']"
        @loginSuccess="handleSuccess"
        @loginFailed="handleFailed"
      />
    </section>
    <!-- 自定义内页 -->
    <el-divider content-position="left"><b>自定义内页</b></el-divider>
    <section>
      <sz-login
        ref="login"
        platform="vr"
        @loginSuccess="handleSuccess"
        @loginFailed="handleFailed"
      >
        <template #bottomAction>
          <el-button type="text" class="right" @click="handleOpenZyk"
            >开通资源库</el-button
          >
        </template>
        <template #insidePageZyk>
          <div>
            <OpenZyk />
          </div>
        </template>
      </sz-login>
    </section>
  </div>
</template>

<script>
import { SzLogin } from "@/components";
import OpenZyk from "@/components/Login/openZyk.vue";
export default {
  name: "SzLoginDemo",
  components: { SzLogin, OpenZyk },
  methods: {
    handleOpenZyk() {
      this.$refs.login.curModule = "Zyk";
    },
    handleSuccess(data, result) {
      console.log("success", data, result);
    },
    handleFailed(data, result) {
      console.log("failed", data, result);
    }
  }
};
</script>

<style lang="scss" scoped></style>
